package com.fjl.basic;

import java.util.ArrayList;
import java.util.List;

/**
 * 死循环的示例代码
 * 
 * @author fjl 2019-3-5 下午2:22:32
 */
public class SixnhuanTest
{
	public static  List<Integer> intLst = new ArrayList<Integer>();
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
//		sixunhuanTest();
		sixunhuanTest2();
	}
	
	//死循环test
	public static void sixunhuanTest()
	{
		List<Integer> mIntLst = new ArrayList<Integer>();
		mIntLst.add(1);
		
		for(int i = 0; i < mIntLst.size(); i++)
		{
			System.out.println(""+mIntLst.get(i));
			mIntLst.add(mIntLst.get(i));
		}
	}
	
	//项目中扣出示例代码，死循环
	public static void sixunhuanTest2()
	{
		List<Integer> intLst2 = new ArrayList<Integer>();
		intLst2.add(1);
		SixnhuanTest sixunhuan = new SixnhuanTest();
		//下面这句话会导致死循环
		sixunhuan.setIntLst(intLst2);
		
		for(int i = 0; i < intLst2.size(); i++)
		{
			System.out.println(""+intLst2.get(i));
			intLst.add(intLst2.get(i));
		}
	}
	
	

	public  List<Integer> getIntLst()
	{
		return intLst;
	}

	public  void setIntLst(List<Integer> intLst)
	{
		this.intLst = intLst;
	}
	
	

}
